<?php include 'login/Restrito.php';?>
<?php 
    	$id = $_GET['id'];
    	require_once  "banco/ConexaoBanco.php";
    	
    	$sql = mysql_query("SELECT * FROM medico WHERE id_medico = $id");
    	$dados = mysql_fetch_array($sql);
    	
    	
    ?>
<div id="conteudo">
	
	<div align="center">
    
    <form action="medicos/MedicoEditar.php" method="post">
    <h3 align="center">Editar dados do Médico</h3>
  	<hr color="#0066FF" size="3px">
    <br />
    <div align="center" style="min-height: 350px; width:auto">
      <table width="700" border="0" align="center">
      
      <tr>
            <td width="100" align="left"><div align="left">Nome</div></td>
            <td width="600"><input name="nome" type="text" size="70" value="<?php echo $dados['m_nome'];?>" /></td>
          </tr>
          <tr>
          	<td align="left">CRM</td>
            <td><input type="text" name="crm" value="<?php echo $dados['m_crm'];?>" maxlength="5"></td>
          </tr>
          <tr>
            <td align="left">CPF</td>
            <td><input type="text" id="cpf" name="cpfU" OnKeyUp="mascaraCpf(this);" maxlength="14" value="<?php echo $dados['m_cpf']; ?>"/><font size="2" color="#555"> Ex: 000.000.000-00 </font> </td>
          </tr>
          <tr>
            <td align="left">Especialidade</td>
            <td><input type="text" name="especialidade" size="70" value="<?php echo $dados['m_especialidade'];?>"/></td>
          </tr>
          <tr>
            <td align="left">Telefone</td>
            <td><input type="text" id="tel" name="fone" maxlength="13" value="<?php echo $dados['m_telefone'];?>" /><font size="2" color="#555"> Ex: (XX)0000-0000 </font> </td>
          </tr>
          <tr>
            <td align="left">Plantão</td>
            <?php if ($dados['m_plantao'] == 0) {
            	$s = 'Não';
            }if ($dados['m_plantao'] == 1) {
            	$s = 'Sim';
            }
            ?>
            <td>Atual: <input type="text" value="<?php echo $s;?>" size="8" disabled><br><input type="radio" name="plantao" value="1" />Sim <br><input type="radio" name="plantao" value="0">Não</td>
          </tr>
          <tr>
          	<td>Status</td>
          	<td><select name="status" >
          	<?php 
          			if ($dados['m_status'] == '1') {
          				echo '<option value="1" selected>ATIVO</option>
          					  <option value="0">INATIVO</option>';
          			}if ($dados['m_status'] == '0') {
          				echo '<option value="1" >ATIVO</option>
          					  <option value="0" selected>INATIVO</option>';
          			}
          	
          	?>
          		</select>
          	</td>
          </tr>
          <tr>
            <td align="left">&nbsp;</td>
            <td><input type="hidden" name="id" value="<?php echo $id;?>"><input type="submit" value="Editar" name="enviar" class="botao" /> </td>
          </tr>
        </table>
        </div>
      
    </form>
    
    </div>
</div>
